#include "PhysicsCommon.h"
#include "math.h"
#include <iostream>
using namespace std;
using namespace PhysicsEngine;
PhysicsBall obj1(1.0f);
PhysicsBall obj2(1.0f);
void updateSimulation(float t, float dt){
        obj1.force = PhysicsVector(5,0,0);
        obj2.force = PhysicsVector(-5,0,0);
        PhysicsVector normal;
        PhysicsVector collide = obj1.collision(&obj2,dt,t);
        obj1.force += collide;
        obj2.force += -collide;
        //Reference quad
        glBegin(GL_QUADS);
                glVertex3f(-1,-1,0);
                glVertex3f(1,-1,0);
                glVertex3f(1,1,0);
                glVertex3f(-1,1,0);
        glEnd();
        return; //Dynamic physics objects, AI control, etc.
}
int main(int argc, char** argv){
        PhysicsInit(argc,argv); //Setup the simulation environment
        addObject(obj1);
        obj1.gravity = false;
        obj1.setMass(1.0f);
        obj1.setPosition(PhysicsVector(-1.3f,0,0));
        addObject(obj2);
        obj2.gravity = false;
        obj2.setMass(1.0f);
        obj2.setPosition(PhysicsVector(1.3f,0,0));
        SetSimSpeed(0.2f);
        //Create Inital Objects here.
        RunSimulation(updateSimulation);        //Run the simulation
}

